<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>认款列表结果 管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div id="ligergrid1" class="sq-grid"></div>
    <span id="close_Btn" style="margin-top: 10px;margin-left: 48%;" class="sq-button sq-button-round co_normal">关闭</span>
</div>

<script type="text/javascript">
    var grid = null;
    $(function () {
        var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
        var dialogData = dialog.get('myDataName');//获取data参数

        grid = $("#ligergrid1").ligerGrid({
            columns: [
                {display: '资金编号', name: 'id', minWidth: 100, align: 'center', enabledSort: false},
                {display: '收款账户', name: 'acceptName', minWidth: 100, align: 'left', enabledSort: false},
                {display: '来款账户', name: 'comeName', minWidth: 100, align: 'center', enabledSort: false},
                /*{display: '来款账号', name: 'comeCode', minWidth: 100, align: 'center', enabledSort: false},*/
                {display: '来款金额', name: 'amount', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        return FormatMoney(rowdata.amount/100);
                    }
                },
                {display: '摘要', name: 'docketRem', minWidth: 100, align: 'left', enabledSort: false},
                {display: '创建时间', name: 'crtTm', minWidth: 100, align: 'center', enabledSort: false,render:renderDate},
                {display: '到账日期', name: 'acceptDate', minWidth: 100, align: 'center', enabledSort: false,render:renderDate},
                {display: '认款人', name: 'identifyOperatorNm', minWidth: 100, align: 'left', enabledSort: false},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow:false,
            rowAttrRender: function (rowdata,rowid){
                if (rowdata.cstId)
                {
                    return "style='background:green;'";
                }else{
                    return "style='background:red;'";
                }
            }
        });
        grid.setHeight(100);

        var jsonObj = {};
        jsonObj.rows = JSON.parse(dialogData);
        grid.set({data: jsonObj});

        $("#pageloading").hide();

        //关闭
        $("#close_Btn").click(function (event) {
            parent.callback();//刷新列表
            frameElement.dialog.close();
        });

    });

    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

</script>

</body>
</html>
